#include <iostream>
#include <string>
using namespace std;

int main(){
    string str1;
    cin>>str1;
    int depth=0;
    int maxdepth=0;
    int len=0;
    int length=str1.length();

    for (int i=0; i<length; i++){
        if (str1[i]=='('){depth++;if (depth>maxdepth){maxdepth=depth;}}
        if (str1[i]==')')depth--;
        if (depth==1&&str1[i]==',')len+=1;
    }
    cout<<len+1<<' '<<maxdepth;



    return 0;

}